import {createApp} from 'vue'
import './style.css'
import App from './App.vue'
import {router} from './router'
import {createPinia} from 'pinia'
import 'virtual:uno.css'

const app: App<Element> = createApp(App)
app.use(router)
app.use(createPinia())
app.directive('loading', {
    created(el, val) {
        if (val.value){
            el.id = 'loader'
        }
    },
    beforeMount(el, val) {
        console.log('beforeMount');
    },
    mounted(el, val) {
        console.log('mounted');
    },
    beforeUpdate(el, val) {
        if (val.value){
            el.id = 'loader'
        }
    },
    updated(el, val) {
        if (val.value){
            el.id = 'loader'
        }
    },
    beforeUnmount(el, val) {
        if (val.value){
            el.id = 'loader'
        }
    },
    unmounted(el, val) {
        console.log('unmounted');
    }
})
app.mount('#app')
